﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RelatorioJogosCliente.aspx.cs" Inherits="SFsoftSite.Relatorios.RelatorioJogosCliente" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1 style="padding-left:30px">
        Relatório de Jogos / Cliente
    </h1>
    <br />
    <table style="border:2px solid #a1a1a1; border-radius:15px;" align="center">
        <tr>
            <td>
                <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" 
                    Height="600px" Width="800px">
                    <Series>
                        <asp:Series Name="Jogos por Cliente" XValueMember="Nome"
                            YValueMembers="Quantidade_de_jogos" Legend="Legend1">
                        </asp:Series>
                    </Series>
                    <ChartAreas>
                        <asp:ChartArea Name="ChartArea1">
                            <AxisY Title="Quantidade de jogos" TitleFont="Arial, 14.25pt, style=Bold">
                            </AxisY>
                            <AxisX Title="Nome do Cliente" TitleFont="Arial, 14.25pt, style=Bold">
                            </AxisX>
                        </asp:ChartArea>
                    </ChartAreas>
                    <Legends>
                        <asp:Legend Name="Legend1">
                        </asp:Legend>
                    </Legends>
                </asp:Chart>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SFGameStoreBD.mdf;Integrated Security=True;User Instance=True" 
                    SelectCommand="SELECT COUNT(ClienteJogo.Cliente) AS Quantidade_de_jogos, Cliente.Nome FROM Cliente INNER JOIN ClienteJogo ON Cliente.ID = ClienteJogo.Cliente GROUP BY Cliente.Nome ORDER BY Quantidade_de_jogos DESC"></asp:SqlDataSource>
            </td>
        </tr>
    </table>
    <br />
    <br />
</asp:Content>
